package com.buddy.design.pattern._01factory.simplefactory;


import com.buddy.design.pattern._01factory.Course;

public class CourseFactory {

    public Course createCourse(Class clazz) {
        try {
            if (clazz != null) {
                return (Course) clazz.newInstance();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
